package com.otitan.la.forest.system.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.Date;

/**
 * 动作元素表
 *
 * @author jiacs
 * @email xxx
 * @date 2020-09-17 14:26:54
 */
@Data
@TableName("\"SYS_PERMISSION\"")
@ApiModel("动作元素表实体")
public class PermissionEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
    * 主键
    */
    @ApiModelProperty(value = "主键", required = true)
    @TableId("\"ID\"")
    private String id;

    /**
    * 动作名称
    */
    @ApiModelProperty(value = "动作名称", required = true)
     @NotEmpty(message = "动作名称不能为空")
     @Length(max = 20, message = "动作名称不能超过 20 个字符")
    @TableField("\"NAME\"")
    private String name;

    /**
    * 所属菜单编码
    */
    @ApiModelProperty(value = "所属菜单编码", required = true)
     @NotEmpty(message = "所属菜单编码不能为空")
     @Length(max = 64, message = "所属菜单编码不能超过 64 个字符")
    @TableField("\"MENU_CODE\"")
    private String menuCode;

    /**
    * 动作类型
    */
    @ApiModelProperty(value = "动作类型", required = true)
     @NotEmpty(message = "动作类型不能为空")
     @Length(max = 36, message = "动作类型不能超过 36 个字符")
    @TableField("\"TYPE\"")
    private String type;


    /**
     * 是否删除
     */
    @ApiModelProperty(value = "是否删除", required = false)
    @TableField(value = "\"IS_DELETE\"", fill = FieldFill.INSERT)
    @TableLogic  //逻辑删除注解
    @JsonIgnore  //忽略
    private Integer isDelete;

    /**
     * 创建用户
     */
    @ApiModelProperty(value = "创建用户", required = false)
    @TableField(value = "\"CREATE_USER\"", fill = FieldFill.INSERT)
    private String createUser;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间", required = false)
    @TableField(value = "\"CREATE_DATE\"", fill = FieldFill.INSERT)
    private Date createDate;

    /**
     * 编辑用户
     */
    @ApiModelProperty(value = "编辑用户", required = false)
    @TableField(value = "\"UPDATE_USER\"", fill = FieldFill.INSERT_UPDATE)
    private String updateUser;

    /**
     * 编辑时间
     */
    @ApiModelProperty(value = "编辑时间", required = false)
    @TableField(value = "\"UPDATE_DATE\"", fill = FieldFill.INSERT_UPDATE)
    private Date updateDate;

    /**
    * 动作编码(A:add)
    */
    @ApiModelProperty(value = "动作编码(A:add)", required = true)
     @NotEmpty(message = "动作编码(A:add)不能为空")
     @Length(max = 64, message = "动作编码(A:add)不能超过 64 个字符")
    @TableField("\"CODE\"")
    private String code;


}
